package com.example.demo;

import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Component;
import tbs.framework.async.container.IAsyncTaskService;
import tbs.framework.async.notifiers.IProgressNotifier;
import tbs.framework.async.task.IAsyncTask;
import tbs.framework.async.task.IProgressable;
import tbs.framework.log.ILogger;
import tbs.framework.log.annotations.AutoLogger;

/**
 * @author Abstergo
 */
@Component
public class LoggerProgressNotify implements IProgressNotifier {
    @AutoLogger
    ILogger logger;

    @Override
    public void notifyProgress(@NotNull IProgressable progressable, @NotNull IAsyncTask task,
        @NotNull IAsyncTaskService service) {
        logger.info(" task id:{}, progress:{}", task.taskId(), progressable.getProgress());
    }
}
